package nbcb;

import java.util.Scanner;

public class P {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, money, res;
        while (sc.hasNext()) {
            n = sc.nextInt();
            if (n == 0) continue;
            res = 0;
            for (int i = 0; i < n; i++) {
                money = sc.nextInt();
                res += count(money);
            }
            System.out.println(res);
        }
    }

    public static int count(int money) {
        int res = 0;
        res += money / 100;
        money %= 100;
        res += money / 50;
        money %= 50;
        res += money /10;
        money %= 10;
        res += money / 5;
        money %= 5;
        res += money / 2;
        money %= 2;
        res += money;
        return res;
    }
}
